package com.clc.cc.registry.api;

import com.clc.cc.common.URL;
import com.clc.cc.common.extension.Adaptive;
import com.clc.cc.common.extension.SPI;

import static com.clc.cc.common.constants.CommonConstants.PROTOCOL_KEY;
import static com.clc.cc.common.extension.ExtensionScope.APPLICATION;

/**
 * ClassName: RegistryFactory
 * Description:RegistryFactory
 *
 * @author chengluchao
 * @date: 2024/5/31 14:45
 * @since cc1
 */
@SPI(scope = APPLICATION)
public interface RegistryFactory {

    /**
     获取对注册中心的连接，然后返回不同注册中心的不同Regsitry的实现对象
     * @param url Registry address, is not allowed to be empty
     * @return Registry reference, never return empty value
     */
    @Adaptive({PROTOCOL_KEY})
    Registry getRegistry(URL url);
}
